/*
 * Image.cpp
 *
 *  Created on: Aug 26, 2011
 *      Author: mengwei.chua
 */

#include "Image.h"
#include "ParserHelper.h"

namespace projectcos
{
namespace tile
{
namespace parser
{

Image::Image()
: m_Source("")
, m_Trans(0)
{

}

Image::~Image()
{

}

bool Image::Parse(const TiXmlElement* element)
{
	if(NULL != element)
	{
		TIXML_QUERY_STRING(element, "source", m_Source);
		TIXML_QUERY_UNSIGNED_INT(element, "trans", m_Trans);
	}
	else
	{
		return false;
	}

	return true;
}

std::string Image::GetSource() const
{
	return m_Source;
}

unsigned int Image::GetTrans() const
{
	return m_Trans;
}

} // parser
} // tile
} // projectcos
